﻿# 依赖vtkm
find_package(VTKm REQUIRED QUIET)

set(target tri-angles)

set(headers
)



set(template_sources
)

set(host_src
	parser/Configuration.cpp
)
set(device_src
main.cpp
application/Application.cpp
application/ReMeshApp.cpp
mesh/Mesh.cpp
mesh/FileMesh.cpp
mesh/GeneratedMesh.cpp
action/Action.cpp
action/CreateMeshAction.cpp
action/CreateSystemAction.cpp
action/CreateExecutioner.cpp
action/AddOutput.cpp
action/AddUserObject.cpp

executioner/Executioner.cpp
executioner/Transient.cpp
system/System.cpp
system/EulerianSystem.cpp
system/SGHSystem.cpp
system/SodSystem.cpp
system/TaylorGreenVortex.cpp
system/OrszagTangVortex.cpp
system/Riemann2D.cpp
output/Output.cpp
output/FileOutput.cpp
output/VTKOutput.cpp

userobject/UserObject.cpp
userobject/RemapUserObject.cpp
)

# 定义target
add_executable(${target} ${host_src} ${device_src})

# 头文件引入
add_library(_compiler_flags INTERFACE)
target_include_directories(_compiler_flags INTERFACE
  ${CMAKE_CURRENT_SOURCE_DIR}
  ${CMAKE_CURRENT_SOURCE_DIR}/action
  ${CMAKE_CURRENT_SOURCE_DIR}/application
  ${CMAKE_CURRENT_SOURCE_DIR}/executioner
  ${CMAKE_CURRENT_SOURCE_DIR}/mesh
  ${CMAKE_CURRENT_SOURCE_DIR}/output
  ${CMAKE_CURRENT_SOURCE_DIR}/parser
  ${CMAKE_CURRENT_SOURCE_DIR}/system
  ${CMAKE_CURRENT_SOURCE_DIR}/userobject
  )


target_link_libraries(${target} PUBLIC _compiler_flags )

#加载 VTK-m 
target_link_libraries(${target} PUBLIC vtkm_filter vtkm_cont vtkm_worklet vtkm_io)

target_link_libraries(${target} 
PRIVATE fmt::fmt
PRIVATE getpot
# PRIVATE nlohmann_json::nlohmann_json
#PRIVATE eigen
#PRIVATE gtest_main 
)


#target_link_options(${target} INTERFACE "/ignore:4819")
option(ENABLE_GPU "Build GPU VERSION" OFF)

#if(ENABLE_GPU)
vtkm_add_target_information(${target} DROP_UNUSED_SYMBOLS MODIFY_CUDA_FLAGS DEVICE_SOURCES ${device_src})
#endif()





